Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: export head for moby #264

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yang-ruixin
Copy link

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

Please describe the motivation of this PR and the goal you want to achieve through this PR.
在导出模型并推理得到特征时,MoBY算法只能导出backbone特征,或者neck (ie, projector_q) 特征,无法导出head (ie, predictor) 特征。
head特征可直接用于以图搜图等项目,这个PR实现导出模型及推理得到head特征的功能。
之前已提issue 260,请见下面链接
#260

Modification

Please briefly describe what modification is made in this PR.

  1. .\easycv\apis\export.py,修改def _export_moby(model, cfg, filename)
  2. .\easycv\models\classification\classification.py,修改def forward_feature(self, img)
  3. .\easycv\models\heads\moby_head.py,新增这个文件
  4. .\easycv\models\heads_init_.py
  5. .\configs\selfsup\moby*,添加export_head功能export = dict(export_neck=True, export_head=True)

Backward-Compatibility-Breaking (Optional)

Does the modification introduce changes that break the backward-compatibility? If so, please describe how it breaks the compatibility in this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
如链接最下面提取特征例子所示https://github.com/alibaba/EasyCV/blob/master/docs/source/tutorials/ssl.md
如果在config文件.\configs\selfsup\moby*,设置export = dict(export_neck=True, export_head=True),当设置export_head=True时,无论export_neck设置为True或False,都会得到head (ie, predictor)特征

Pull-Request Todo List

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  3. The documentation has been modified accordingly, like docstring or example tutorials.

@CLAassistant
Copy link

CLAassistant commented Jan 8, 2023

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants